package com.fz.service.impl;

import com.fz.entity.Role;
import com.fz.mapper.RoleMapper;
import com.fz.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 存储系统角色信息 服务实现类
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
    @Override
    public boolean add(String name,String description,String permission) {
       Role tRole = new Role(
                name,
                description,
                permission
        );
        return this.save(tRole);
    }

    @Override
    public boolean update(long id,String name,String description,String permission) {
        return this.updateById(new Role(
                id,
                name,
                description,
                permission
        ));
    }

    @Override
    public boolean del(long id, boolean status) {
        return this.updateById(new Role(id,status));
    }

}
